<?php

    if (!defined('BASEPATH'))
        exit('No direct script access allowed');

    if (!function_exists('cache_filename')) {

        /**
         * Create cahe filename
         */
        function cache_filename($data, $mehod) {
            $filename = 'hotels_' . $mehod . '';

            foreach ($data as $key => $value):
                if (is_array($value)) {
                    foreach ($value as $value) {
                        $filename.='_' . $key . '-' . $value;
                    }
                } else {
                    $filename.='_' . $key . '-' . $value;
                }
            endforeach;

            return $filename;
        }

    }